#ifndef IO_H
#define IO_H

#include <stdint.h>

enum IO_enableCtrl{
  eDisable,
  eEnable
};
typedef struct IO_pin_info{
  uint32_t port; /* GPIO port definitions */
  uint32_t pin;  /* GPIO pin definitions */
} IO_pin_info_t;
typedef struct IO_led_flicker_time{
  uint32_t speed_led_time[4];
  uint32_t status_led_time[4];
  uint32_t fault_led_time[4];
}IO_led_flicker_time_t;
enum LED_Defines {
  xSPEED_LED, // xSPEED（LED指示灯）
  STATUS_LED, // STATUS（LED指示灯）
  FAULT_LED,  // FAULT（LED指示灯）
  LED_NUM,
};
enum LED_Status {
  LED_OFF,
  LED_ON,
};
/*AI电压采样，采样电压范围配置*/
enum AI_VOL_CHANNEL {
  eU0,
  eU1,
  eU2,
  eU3,
  eU4,
  eU5,
  eU6,
  eU7,
  eU8,
  eU9,
  AI_SET_VOL_CH_NUM,
};
/*AI配置未电流采样端口*/
enum AI_CUR_CHANNEL {
  eC0,
  eC1,
  eC2,
  eC3,
  eC4,
  eC5,
  eC6,
  eC7,
  eC8,
  eC9,
  AI_SET_CUR_CH_NUM,
};
enum LowSide_CHANNEL {
  eLowSide_0,
  eLowSide_1,
  eLowSide_2,
  eLowSide_3,
  eLowSideNumber
};
typedef enum radio_out{
  eM0,
  eM1,
  eM2,
  eM_number
}radio_out_t;
extern void IO_Init(void);
/*AI 电压设置，0：0~5V；1：0~10V*/
extern void au_voltage_range_sel(uint8_t ch,uint8_t tData);
/*AI复用为电流采样使能*/
extern void au_Current_sel(uint8_t ch,uint8_t tData);
/*LED指示灯控制*/
extern void IO_LedCtrl(enum LED_Defines led,enum LED_Status status);
/*CAN 终端电阻使能/禁止*/
extern void IO_Can_TerminatorCtrl(enum IO_enableCtrl tData);

extern void IO_LowSideOut(uint8_t h,uint8_t tData);

extern uint8_t IO_read_aux(void);
void io_Mx_out_ctrl(uint8_t ch,uint8_t tData);
#endif
